<template>
  <div>
    <div class="romanUser-container">
      <!-- 顶部操作区 -->
      <div class="romanUser-container-top">
        <div class="romanUser-container-top_one">
          <div class="wrap_inp">
            <span class="text_lable">罗曼ID:</span>
            <div class="btn">
              <el-input v-model="lmid"></el-input>
            </div>
          </div>
          <div class="wrap_inp">
            <span class="text_lable">昵称:</span>
            <div class="btn">
              <el-input v-model="nickname"></el-input>
            </div>
          </div>
          <div class="wrap_inp">
            <span class="text_lable">手机:</span>
            <div class="btn">
              <el-input v-model="mobilePhone"></el-input>
            </div>
          </div>
          <div class="wrap_inp">
            <span class="text_lable">真实姓名:</span>
            <div class="btn">
              <el-input v-model="name"></el-input>
            </div>
          </div>
          <div class="wrap_inp">
            <span class="text_lable">性别:</span>
            <div class="btn">
              <el-select v-model="region">
                <el-option :label="item.name" :value="item.id" v-for="item in genderSet" :key="item.id"></el-option>
              </el-select>
            </div>
          </div>
          <div class="wrap_inp">
            <span class="text_lable">会员:</span>
            <div class="btn">
              <el-select v-model="member">
                <el-option :label="item.name" :value="item.id" v-for="item in memberList" :key="item.id"></el-option>
              </el-select>
            </div>
          </div>
          <div class="wrap_inp">
            <span class="text_lable">违规聊天:</span>
            <div class="btn">
              <el-select v-model="violation">
                <el-option :label="item.name" :value="item.id" v-for="item in violationList" :key="item.id"></el-option>
              </el-select>
            </div>
          </div>
        </div>
        <div class="romanUser-container-top_two">
          <div class="wrap_inp">
            <span class="text_lable" style="padding-left: 15px">年龄:</span>
            <div class="btn">
              <el-select v-model="ageId">
                <el-option :label="item.name" :value="item.id" v-for="item in ageList" :key="item.id"></el-option>
              </el-select>
            </div>
          </div>
          <div class="wrap_inp">
            <span class="text_lable">身高:</span>
            <div class="btn">
              <el-select v-model="heightId">
                <el-option :label="item.name" :value="item.id" v-for="item in heighList" :key="item.id"></el-option>
              </el-select>
            </div>
          </div>
          <div class="wrap_inp">
            <span class="text_lable">学历:</span>
            <div class="btn">
              <el-select v-model="educationId">
                <el-option :label="item.name" :value="item.id" v-for="item in educationList" :key="item.id"></el-option>
              </el-select>
            </div>
          </div>
          <div class="wrap_inp">
            <span class="text_lable">身份证号:</span>
            <div class="btn">
              <el-input v-model="idNumber"></el-input>
            </div>
          </div>
          <div class="wrap_inp">
            <span class="text_lable">星级:</span>
            <div class="btn">
              <el-select v-model="starId">
                <el-option :label="item.name" :value="item.id" v-for="item in starList" :key="item.id"></el-option>
              </el-select>
            </div>
          </div>
          <div class="wrap_inp">
            <span class="text_lable">积分:</span>
            <div class="btn">
              <el-input v-model="integral"></el-input>
            </div>
          </div>
          <div class="wrap_inp">
            <div class="text_lable">
              <el-button type="primary" icon="el-icon-search" @click.native="search()">搜索</el-button>
            </div>
            <div class="btn">
              <el-button type="info" icon="el-icon-delete" plain @click.native="clearSearch()">清空</el-button>
            </div>
          </div>
        </div>
      </div>
      <!-- 表格操作区 -->
      <div class="romanUser-container-top-operation">
        <div class="operation_left">
          <el-button type="danger" icon="el-icon-delete" plain @click="deleteList()" :disabled="listId && listId.length > 0 ? isdisabled = false : isdisabled = true">删除</el-button>
          <el-button type="primary" icon="el-icon-user" plain @click="opneisweeklystar()" :disabled="listId && listId.length > 0 ? isdisabled = false : isdisabled = true">每周之星</el-button>
          <el-button type="success" icon="el-icon-plus" plain @click="openVisits()" :disabled="listId && listId.length > 0 ? isdisabled = false : isdisabled = true">访问次数</el-button>
          <el-button type="info" icon="el-icon-turn-off-microphone" @click="openforbiddenWords()" plain :disabled="listId && listId.length > 0 ? isdisabled = false : isdisabled = true">禁言</el-button>
        </div>
        <div class="operation_right">
          <el-button
            icon="el-icon-refresh"
            size="medium"
            style="font-size: 16px; font-weight: 800; color: #000"
            circle
            @click.native="refresh()"
          ></el-button>
          <el-button
            icon="el-icon-search"
            size="medium"
            style="font-size: 16px; font-weight: 800; color: #000"
            circle
            @click.native="search()"
          ></el-button>
        </div>
      </div>
      <!-- 表格内容 -->
      <div class="romanUser-container-content">
        <template v-if="tableData && tableData.length > 0">
          <el-table
            ref="multipleTable"
            border
            :data="tableData"
            v-loading="loading"
            element-loading-text="数据加载中..."
            tooltip-effect="dark"
            height="500"
            style="width: 100%"
            :header-cell-style="{ backgroundColor: '#FAFAFA' }"
            @selection-change="selectDeleta"
            @select-all="selectAllList"
            :default-sort="{prop: 'visitToday', order: 'descending'}"
          >
            <el-table-column type="selection" width="55"> </el-table-column>
            <el-table-column type="index" label="#"> </el-table-column>
            <el-table-column prop="lmId" label="罗曼ID"> </el-table-column>
            <el-table-column prop="nickname" label="昵称"> </el-table-column>
            <el-table-column label="头像">
              <template slot-scope="scope">
                <el-avatar size="medium" :src="scope.row.userImg"></el-avatar>
              </template>
            </el-table-column>
            <el-table-column label="手机" show-overflow-tooltip width="105">
              <template slot-scope="scope">
                {{ scope.row.mobilePhone ? scope.row.mobilePhone.replace(/(\d{3})(\d{4})(\d{4})/g, '$1****$3') : '' }}
              </template>
            </el-table-column>
            <el-table-column prop="name" label="真实姓名"> </el-table-column>
            <el-table-column prop="idNumber" label="身份证号" show-overflow-tooltip>
              <template slot-scope="scope">
                {{ scope.row.idNumber ? scope.row.idNumber.replace(/^(.{6})(?:\w+)(.{4})$/ , '$1********$2') : '' }}
              </template>       
            </el-table-column>
            <el-table-column prop="sex" label="性别"></el-table-column>
            <el-table-column prop="age" label="年龄" sortable></el-table-column>
            <el-table-column prop="residence" label="居住地"></el-table-column>
            <el-table-column prop="height" label="身高" sortable></el-table-column>
            <el-table-column prop="education" label="学历"></el-table-column>
            <el-table-column prop="starId" label="星级" sortable></el-table-column>
            <el-table-column prop="member" label="会员"></el-table-column>
            <el-table-column prop="integral" label="积分" sortable></el-table-column>
            <el-table-column prop="illegalchat" label="违规聊天"></el-table-column>
            <el-table-column prop="forbidden" label="禁言"></el-table-column>
            <el-table-column prop="activity" label="活动" sortable>
              <template slot-scope="scope">
                {{ scope.row.activity }}次
              </template>  
            </el-table-column>
            <el-table-column prop="visitToday" label="今日访问" width="103" sortable>
              <template slot-scope="scope">
                {{ scope.row.visitToday }}次
              </template>   
            </el-table-column>
            <el-table-column fixed="right" label="操作" width="250">
              <template slot-scope="scope">
                <el-button type="text" size="medium" @click.native="viewDetails(scope.row)">
                  <span class="iconfont icon-chakanxiangqingtubiao" style="font-size:18px;"></span>详情
                </el-button>
                <el-button type="text" size="medium" @click.native="openMembership(scope.row)">
                  <span class="iconfont icon-31huiyuan" style="font-size:18px;"></span>会员
                  </el-button>
                <el-button type="text" size="medium" @click.native="openintegral(scope.row)">
                  <span class="iconfont con icon-jifen" style="font-size:18px;"></span>积分
                  </el-button>
                <el-button type="text" size="medium" @click.native="opAdjustStar(scope.row)">
                  <span class="iconfont icon-ge_xingji" style="font-size:18px;"></span>星级
                  </el-button>
              </template>
            </el-table-column>
          </el-table>
        </template>
        <template v-else>
           <el-empty description="暂无数据" :image-size="250"></el-empty>
        </template>
      </div>
      <!-- 底部分页 -->
      <div class="romanUser-container-footer_page">
        <template>
              <el-pagination
                  background
                  @size-change="handleSizeChange"
                  @current-change="handleCurrentChange"
                  :current-page="currentPage"
                  :page-sizes="[10, 15, 20, 50,100]"
                  :page-size="pageSize"
                  layout="total, sizes, prev, pager, next, jumper"
                  :total="total">
              </el-pagination>
        </template>
      </div>
    </div>
    <!-- 用户详情 -->
    <viewdetails v-if="viewShow" :propsObj="typeObj" v-on:closeTheReportDrawer="closeTheReportDrawer"></viewdetails>
    <!-- 积分 -->
    <integral v-if="isintegral" :propsObj="isintegralObJ" v-on:closeTheReportDrawer="isintegralcloseDrawer"
              v-on:userintegral="userintegral"></integral>
    <!-- 星级 -->
    <adjustStar v-if="openAdjustStar" :propsObj="AdjustStarObj" v-on:closeTheReportDialog="closeTheReportDialog"
                v-on:userAdjustStar="userAdjustStar"></adjustStar>
    <!-- 会员 -->
    <membership v-if="membership" :propsObj="membershipObj" v-on:closeMembershipObjDialog="closeMembershipObjDialog"
                v-on:emitUserData="emitUserData"></membership>
    <!-- 访问次数 -->
    <visits v-if="isnumberOfvisits" :propsObj="numberOfvisitsObj" v-on:closeNumberOfvisitsDialog="closeNumberOfvisitsDialog"
            v-on:uservisits="uservisits"></visits>
    <!-- 禁言 -->
    <forbiddenWords v-if="isforbiddenWords" v-on:closeforbiddenWords="closeforbiddenWords"
                    v-on:emitforbiddenWords="emitforbiddenWords"></forbiddenWords>
    <!-- 每周之星 -->
    <weeklystar v-if="isweeklystar" :propsObj="listId" v-on:closeisweeklystar="closeisweeklystar"
               v-on:clearSelectionUser="clearSelectionUser"></weeklystar>
  </div>
</template>

<script>
import viewDetails from "./components/viewDetails.vue";   // 详情
import integral from "./components/integral.vue";   // 积分
import adjustStar from "./components/adjustStar.vue";   // 星级
import membership from "./components/membership.vue";   // 会员
import visits from "./components/numberOfvisits.vue";   // 访问次数
import forbiddenWords from "./components/forbiddenWords.vue";   // 禁言
import weeklystar from "./components/weeklystar.vue";   // 每周之星

export default {
  components: {
    viewdetails: viewDetails,
    integral,
    adjustStar,
    membership,
    visits,
    forbiddenWords,
    weeklystar
  },
  data() {
    return {
      lmid: null,
      nickname: null,
      mobilePhone: null,
      name: null,
      region: '0',
      member: '0',
      violation: '1',
      ageId: '0',
      heightId: '0',
      educationId: '5',
      idNumber: null,
      starId: '2',
      integral: null,
      loading: false,
      total: 100,  // 总条数
      pageSize: 10, // 一页10条
      pageNumber: 1, // 页数
      currentPage: 1,  // 当前第几页
      genderSet: [
        { id: '0', name: '全部' },
        { id: '1', name: '男' },
        { id: '2', name: '女' },
      ],
      memberList: [
        { id: '0', name: '游客' },
        { id: '1', name: '普通会员' },
        { id: '2', name: '荣誉会员' },
        { id: '3', name: 'VIP会员' },
        { id: '4', name: '超级会员' },
      ],
      violationList: [
        { id: '1', name: '有' },
        { id: '0', name: '无' },
      ],
      ageList: [
        { id: '0', name: '全部' },
        { id: '1', name: '18-22岁' },
        { id: '2', name: '23-25岁' },
        { id: '3', name: '25-30岁' },
        { id: '4', name: '30-35岁' },
        { id: '5', name: '35-40岁' },
        { id: '6', name: '40-45岁' },
        { id: '7', name: '45-50岁' },
        { id: '8', name: '50-55岁' },
        { id: '9', name: '55-60岁' },
        { id: '10', name: '60岁以上' },
      ],
      heighList: [
        { id: '0', name: '全部' },
        { id: '1', name: '150cm以下' },
        { id: '2', name: '150-160cm' },
        { id: '3', name: '160-165cm' },
        { id: '4', name: '165-170cm' },
        { id: '5', name: '170-175cm' },
        { id: '6', name: '175-180cm' },
        { id: '7', name: '180-185cm' },
        { id: '8', name: '185-190cm' },
        { id: '9', name: '190cm以上' },
      ],
      educationList: [
        { id: '0', name: '全部' },
        { id: '1', name: '小学' },
        { id: '2', name: '初中' },
        { id: '3', name: '高中' },
        { id: '4', name: '大专' },
        { id: '5', name: '本科' },
        { id: '6', name: '硕士' },
        { id: '7', name: '博士' },
        { id: '8', name: '研究生' },
      ],
      starList: [
        { id: '0', name: '全部' },
        { id: '1', name: '1星' },
        { id: '2', name: '2星' },
        { id: '3', name: '3星' },
        { id: '4', name: '4星' },
        { id: '5', name: '5星' }
      ],    
      istrue: false, 
      tableData: [],  // 列表数据
      listId: [],  // 选中的数据
      isdisabled: false, // 是否使用删除按钮
      viewShow: false, // 是否显示用户详情对话框
      isintegral: false, // 是否显示赠送积分对话框
      openAdjustStar: false,  // 是否展示调整星级对话框
      membership: false, // 是否显示调整会员对话框
      isnumberOfvisits: false, // 是否显示访问次数对话框
      isforbiddenWords: false, // 是否显示禁言对话框
      isweeklystar: false, // 是否显示每周之星对话框
      typeObj: {},     // 用户详情数据
      isintegralObJ: {},
      AdjustStarObj: {},
      membershipObj: {},
      numberOfvisitsObj: {}
    };
  },
  created() {
    this.getData()
  },
  methods: {
    // 获取表格列表
    getData(){
      this.loading = true;
      const number = Math.round(Math.random()*1500); 
      setTimeout(() => {
        const list = [
          {
            lmId: '88121',
            nickname: '落叶', 
            userImg: '',
            mobilePhone: '15219571006',
            name: '虹雪飘',
            idNumber: '440983200009233811',
            sex: '女',
            age: '21',
            residence: '广东深圳',
            height: '180',
            education: '本科',
            starId: '2',
            memberId: '4',
            member: '超级VIP',
            integral: 100, 
            illegalchat: '3次',
            forbidden: '永久',
            activity: 1,
            visitToday: 1,
            daysRemaining: 1,
          },
          {
            lmId: '88122',
            nickname: '夏天', 
            userImg: '',
            mobilePhone: '15219571006',
            name: '夏白白',
            idNumber: '440983200009233811',
            sex: '女',
            age: '22',
            residence: '广东广州',
            height: '180',
            education: '本科',
            starId: '1',
            memberId: '1',
            member: '普通会员',
            integral: 100, 
            illegalchat: '无',
            forbidden: '永久',
            activity: 3,
            visitToday: 2,
            daysRemaining: 3,
          },
          {
            lmId: '88123',
            nickname: '秋风', 
            userImg: '',
            mobilePhone: '15219571006',
            name: '小王',
            idNumber: '440983200009233811',
            sex: '男',
            age: '19',
            residence: '广东佛山',
            height: '180',
            education: '本科',
            starId: '3',
            memberId: '2',
            member: '荣誉会员',
            integral: 100, 
            illegalchat: '无',
            forbidden: '永久',
            activity: 3,
            visitToday: 3,
            daysRemaining: 5,
          },
          {
            lmId: '88124',
            nickname: '晚霞', 
            userImg: '',
            mobilePhone: '15219571006',
            name: '张灰灰',
            idNumber: '440983200009233811',
            sex: '女',
            age: '23',
            residence: '福州厦门',
            height: '180',
            education: '本科',
            starId: '4',
            memberId: '2',
            member: '荣誉会员',
            integral: 100, 
            illegalchat: '3次',
            forbidden: '永久',
            activity: 5,
            visitToday: 5,
            daysRemaining: 2,
          },
          {
            lmId: '88125',
            nickname: '冰雪', 
            userImg: '',
            mobilePhone: '15219571006',
            name: '杨嘿嘿',
            idNumber: '440983200009233811',
            sex: '男',
            age: '19',
            residence: '广东深圳',
            height: '180',
            education: '本科',
            starId: '5',
            memberId: '3',
            member: 'VIP会员',
            integral: 100, 
            illegalchat: '1次',
            forbidden: '永久',
            activity: 4,
            visitToday: 2,
            daysRemaining: 3,
          },
          {
            lmId: '88126',
            nickname: '落叶', 
            userImg: '',
            mobilePhone: '15219571006',
            name: '杨灰灰',
            idNumber: '440983200009233811',
            sex: '男',
            age: '20',
            residence: '广东广州',
            height: '180',
            education: '本科',
            starId: '5',
            memberId: '4',
            member: '超级会员',
            integral: 100, 
            illegalchat: '无',
            forbidden: '永久',
            activity: 5,
            visitToday: 1,
            daysRemaining: 1,
          },
          {
            lmId: '88127',
            nickname: '落叶', 
            userImg: '',
            mobilePhone: '15219571006',
            name: '杨灰灰',
            idNumber: '440983200009233811',
            sex: '男',
            age: '20',
            residence: '广东广州',
            height: '180',
            education: '本科',
            starId: '1',
            memberId: '1',
            member: '普通会员',
            integral: 100, 
            illegalchat: '无',
            forbidden: '永久',
            activity: 6,
            visitToday: 2,
            daysRemaining: 1,
          },
          {
            lmId: '88128',
            nickname: '落叶', 
            userImg: '',
            mobilePhone: '15219571006',
            name: '杨灰灰',
            idNumber: '440983200009233811',
            sex: '男',
            age: '20',
            residence: '广东广州',
            height: '180',
            education: '本科',
            starId: '1',
            memberId: '1',
            member: '普通会员',
            integral: 100, 
            illegalchat: '8次',
            forbidden: '永久',
            activity: 7,
            visitToday: 6,
            daysRemaining: 1,
          },
          {
            lmId: '88129',
            nickname: '落叶', 
            userImg: '',
            mobilePhone: '15219571006',
            name: '杨灰灰',
            idNumber: '440983200009233811',
            sex: '男',
            age: '20',
            residence: '广东广州',
            height: '180',
            education: '本科',
            starId: '2',
            memberId: '2',
            member: '荣誉会员',
            integral: 100, 
            illegalchat: '无',
            forbidden: '永久',
            activity: 23,
            visitToday: 9,
            daysRemaining: 1,
          },
          { 
            lmId: '88130',
            nickname: '落叶', 
            userImg: '',
            mobilePhone: '15219571006',
            name: '杨灰灰',
            idNumber: '440983200009233811',
            sex: '男',
            age: '20',
            residence: '广东广州',
            height: '180',
            education: '本科',
            starId: '1',
            memberId: '4',
            member: '超级VIP',
            integral: 100, 
            illegalchat: '1次',
            forbidden: '永久',
            activity: 8,
            visitToday: 1,
            daysRemaining: 1,
          },
          {
            lmId: '88131',
            nickname: '落叶', 
            userImg: '',
            mobilePhone: '15219571006',
            name: '杨灰灰',
            idNumber: '440983200009233811',
            sex: '男',
            age: '20',
            residence: '广东广州',
            height: '180',
            education: '本科',
            starId: '3',
            memberId: '1',
            member: '普通会员',
            integral: 100, 
            illegalchat: '2次',
            forbidden: '永久',
            activity: 9,
            visitToday: 2,
            daysRemaining: 1,
          },     
        ];
        this.tableData = list;
        this.loading = false;
      },number)
    },
    // 搜索
    search(){
      this.getData()
    },
    // 刷新表格列表
    refresh(){
      this.getData()
    },
    // 分页功能 
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.pageSize = val;  // 选择几条一页
      this.getData()
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.currentPage = val;   // 当前页
      this.pageNumber = val; // 页数
      this.getData()
    },
    // 清空搜索
    clearSearch() {
      this.lmid = null ;
      this.nickname = null;
      this.mobilePhone = null;
      this.name = null;
      this.region = '0';
      this.member = '0';
      this.violation = '1';
      this.ageId = '0';
      this.heightId = '0';
      this.educationId = '5';
      this.idNumber =  null;
      this.starId = '2';
      this.integral = null
    },
    // 选中数据
    selectDeleta(selection){
      this.listId = selection
      this.istrue = false;  
    },
    // 全选
    selectAllList(selection){
      this.listId = selection;
      this.istrue = true;
    },
    // 是否删除列表
    delArray(){
      const list = this.listId;
      if (list && list.length > 0) {
        list.forEach( (item) => {    // 将选中数据遍历
          this.tableData.forEach(( item1, index1 ) => {     // 遍历源数据
            if (item.lmId === item1.lmId) {
              this.tableData.splice(index1,1)
            }
          })
        })
      }
    },
    // 确定删除列表
    deleteList(){
      this.$confirm('确定将选择的数据进行删除？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        closeOnClickModal: false
      }).then(() => {
        this.delArray();
        this.$message.success('删除成功！');
        this.$refs.multipleTable.clearSelection()  // 清除选中状态
      }).catch(() => {
        // this.$message.info('取消删除！');          
      });
    },
    // 详情
    viewDetails(row){
      this.typeObj = row
      this.viewShow = true;
    },
    // 关闭用户详情弹框
    closeTheReportDrawer(){
      this.viewShow = false;
    },
    // 积分
    openintegral(row){
      this.isintegralObJ = row;
      this.isintegral = true;
    },
    // 关闭积分对话框
    isintegralcloseDrawer(){
      this.isintegral = false;
    },
    // 星级
    opAdjustStar(row){
      this.AdjustStarObj = row;
      this.openAdjustStar = true;
    },
    // 关闭调整星级对话框
    closeTheReportDialog(){
      this.openAdjustStar = false;
    },
    // 星级
    openMembership(row){
      this.membershipObj = row;
      this.membership = true;
    },
    // 关闭会员对话框
    closeMembershipObjDialog(){
      this.membership = false;
    },
    // 访问次数
    openVisits(){
      this.isnumberOfvisits = true;
    },
    // 关闭访问次数弹框
    closeNumberOfvisitsDialog(){
      this.isnumberOfvisits = false;
    },
    // 增加访问次数
    uservisits(row){
      this.$nextTick(()=>{
        if (this.listId && this.listId.length > 0) {
          this.listId.forEach( item =>{
            item.visitToday += row.visitsInput;
          })
        }
      })
    },
    // 禁言
    openforbiddenWords(){
      this.isforbiddenWords = true;
    },
    // 关闭禁言对话框
    closeforbiddenWords(){
      this.isforbiddenWords = false;
    },
    // 每周之星
    opneisweeklystar(){
      this.isweeklystar = true;
    },
    // 清空用户的选择
    clearSelectionUser(row){
      if (this.istrue === false) {
        if (this.tableData && this.tableData.length > 0) {
          this.tableData.forEach( (item,index) => {
            if (item.lmId === row.lmId) {
              this.$refs.multipleTable.toggleRowSelection(item,false);
            }
          });
        }
      }
    },
    // 关闭每周之星对话框
    closeisweeklystar(){
      this.isweeklystar = false;
    },
    // 修改禁言
    emitforbiddenWords(row){
      this.$nextTick(()=>{
        if (this.listId && this.listId.length > 0) {
          this.listId.forEach( item =>{
            if (row.radioName === '取消禁言') {
              item.forbidden = '否';
            }else {
              item.forbidden = row.radioName;
            }
          })
        }
      })
    },
    // 修改会员数据
    emitUserData(item){
      this.$nextTick( ()=> {
        if (this.tableData && this.tableData.length > 0) {
          for (let i = 0; i < this.tableData.length; i++){
            if (this.tableData[i].lmId === item.lmId) {
              this.tableData[i].memberId = item.memberId;
              this.tableData[i].member = item.member;
              break;
            }
          }
        }
      })
    },
    // 修改星级数据
    userAdjustStar(item){
      this.$nextTick(()=>{
        if (this.tableData && this.tableData.length > 0) {
          for (let i = 0; i < this.tableData.length; i++){
            if (this.tableData[i].lmId === item.lmId) {
              this.tableData[i].starId = item.starId;
              break;
            }
          }
        }
      })
    },
    // 修改积分数据
    userintegral(item){
      this.$nextTick(()=>{
        if (this.tableData && this.tableData.length > 0) {
          for (let i = 0; i < this.tableData.length; i++){
            if (this.tableData[i].lmId === item.lmId) {
              this.tableData[i].integral = item.integral;
              break;
            }
          }
        }
      }) 
    }
  }
};
</script>
<style lang="less" scoped>
@import '@/style/variables.less';
.romanUser-container {
  background-color: @bg-color-container;
  padding: 15px;
  @media (max-width: @screen-sm-max) {
    padding: 0 32px 67px;
  }
  .romanUser-container-top {
    .romanUser-container-top_one {
      display: flex;
      .wrap_inp {
        width: 20%;
        display: flex;
        // justify-content: center;
        align-items: center;
        margin-right: 10px;
        .text_lable {
          width: auto;
          margin-right: 10px;
        }
        .btn {
          width: 60%;
        }
      }
    }
    .romanUser-container-top_two {
      margin-top: 10px;
      display: flex;
      .wrap_inp {
        width: 20%;
        display: flex;
        // justify-content: center;
        align-items: center;
        margin-right: 10px;
        .text_lable {
          width: auto;
          margin-right: 10px;
        }
        .btn {
          width: 60%;
        }
      }
    }
  }
  .romanUser-container-top-operation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    .operation_right {
      // margin-right: 12px;
    }
  }
  .romanUser-container-content {
    margin-top: 10px;
  }
  .romanUser-container-footer_page {
    margin-top: 10px;
    display: flex;
    justify-content: end;
  }
}
</style>